home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / mac / bib.hqx / Bib Stack / stack_-1.xml < prev    next >
Extensible Markup Language  |  1989-12-05  |  20KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>33</cardCount>
  7.     <cardID>3057</cardID>
  8.     <listID>6551</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>-- Some global vars---- dupList: a return-separated list of the keys of duplicated cards-- dupCard: a comma-separated list of card numbers of the corresponding--   keys in dupList.-- searchField: the id of the field last used in a search.-- searchString: the string last used in a search.--on openstack-- cardList: a return-separated list of bibliography backgrounds-- dupList is the list of duplicate keys.-- fieldList: a comma-separated list of the fields on bibliogrpahy--   cards. It is used to get field indexes for the find commands.-- findList is the menu for fields to search.-- journalList: a return-separated list of journals.-- monthList: a return-separated list of months.-- readStatusList: a comma-separated list of possible entries in the--   "Read Status" field.-- yearList: a returns-separated list of the past 5 years (descending).-- firstRefCard is the first card containing references.-- recentCard isglobal cardList, dupList, fieldList, findList, journalListglobal readStatusList, monthList, yearListglobal firstRefCard, recentCard, termCharshow menubarhide message box-- cardListput "Article"&return&"Book"&return&"Booklet"&return&"In Book"&return&┬¼"In Collection"&return&"In Proceedings"&return&"Manual"&return&┬¼"Masters Thesis"&return&"Misc."&return&"Ph.d Thesis"&return&┬¼"Proceedings"&return&"Tech Report"&return&"Unpublished"into cardList-- dupListput "No Duplicates" into dupList-- fieldListput "Card Type,Read Status,Key,"&┬¼"Author,Title,Journal,"&┬¼"Book Title,Month,Year,Chapter,"&┬¼"Pages,Editor,Organization,"&┬¼"Publisher,How Published,Address,"&┬¼"Volume,Series,Edition,Type,"&┬¼"Number,Bibliogrpahy Note,Notes,"&┬¼"Key Words,Location" into fieldList-- journalListset lockScreen to truepush cardgo to card "Journal Names"--put line 1 of field "Names" into journalList--put the number of lines of field "Names" into numLines--repeat with linenr = 2 to numLines--  put journalList & return & line linenr of field "Names" into journalList--end repeatpop card-- monthListput "January"&return&"February"&return&"March"&return&"April"&return&┬¼"May"&return&"June"&return&"July"&return&"August"&return&"September"&┬¼return&"October"&return&"November"&return&"December" into monthList-- readStatusListput "Read & Filed,Read & Returned,Filed & Not Read,Find It"┬¼into readStatusList-- yearListput fourth word of the abbreviated date into yearput year into yearListrepeat 5 timesput year-1 into yearput yearList & return & year into yearListend repeat-- findList. This list is made last so it can include other lists.put "Repeat Search"&return&"Key"&return&"Author"&return&"Title"&return&┬¼"Read Status,"&readStatusList&return&┬¼"Notes"&return&"Key Words"&return&"Organization"&return&┬¼"All Fields"&return&"Pick Field...,"&fieldList┬¼into findList-- firstRefCardput (number of first card of bkgnd "CardBeforeBibEntries")+1┬¼into firstRefCardput 1 into recentCard  -- used in install and delete buttons--go to first card of bkgnd "Article"end openstackon closestackvisual effect iris closeget the freeSize of this stackif it > 1024*10 thenput "Compacting stack..."doMenu Compact Stackput emptyhide messageend ifend closestackon goToCardglobal cardListput the rect of the target into tempRectput item 1 of HPopupMenu(cardList,0,item 4 of tempRect-1,┬¼(item 1 of tempRect)+1) into cardNumberif cardNumber < 1 then exit goToCardput line cardNumber of cardList into bkgndNamego to background bkgndNameend goToCardon findCard -- used to find a cardglobal findList, readStatusList, searchField, searchStringput the rect of the target into tempRectput HPopUpMenu (findList, 0,item 4 of tempRect-1,┬¼(item 1 of tempRect)+1) into itemNumberif itemNumber = 0 then exit findCardput line item 1 of itemNumber of findList into fieldName-- If a hierarchical item was picked, the field name include all-- the hierarchical menu, too. Get rid of it.if "," is in fieldName put item 1 of fieldName into fieldNameput item 2 of itemNumber into subNumif fieldName is not "Repeat Last" then-- tempID holds the id of the field to look in. 0 means everywhere.if fieldName is "Pick Field ..." thenput subNum into tempIDelse if fieldName is "All Fields" thenput 0 into tempIDelseput fieldNumber(fieldName) into tempIDend ifif "Read Status" is in fieldName thenput item subNum of readStatusList into searchStringelseask "Search for:" with searchStringif it is empty then exit findCardelse put it into searchStringend if-- record field and string information.put tempID into searchFieldend ifif searchField is 0 then-- Set up the message box so all the user need do is hit return.put "find " & searchStringhide messagefind searchStringelse-- Set up the message box so all the user need do is hit return.put "find " & searchString & " in field " & searchFieldfind searchString in field searchFieldhide messageend ifend findCardon findSelectionif the locktext of the target is true then   --unlock the field ifset locktext of target to false            --it is locked.end ifput the optionKey into optStatusput the commandKey into cmdStatusif optStatus is down thenput fieldNumber("Key Words") into tempIDelse if cmdStatus is down thenput fieldNumber("Key") into tempIDelseexit findSelectionend ifif selection is not empty then  --something was selectedput selection into SelectedWordif space is in SelectedWord then  --the user selected more than 1 wordplay "boing" "Cs5"exit findSelection            --and exit to wait for another selectionend ifplay "harpsichord" "Ct6"find SelectedWord in field tempIDif the result is "not found" then--play "boing" "Cs5"play "PWscream"elseput tempID into searchFieldput SelectedWord into searchStringput "find" && quote & SelectedWord & quote &&┬¼"in field" &&  SearchFieldhide messageend ifend ifend findSelectionon checkKeysglobal dupList, dupCards, firstRefCardpush cardset cursor to 4set lockScreen to trueput "Sorting cards..."sort by field "Key"go to card firstRefCardput empty into prevKeyput true into firstDupput 1 into dupCountput "Checking for duplicate keys..."repeat while number of this card <> 1if background field Key is not empty thenif background field Key = prevKey thenput dupCount +1 into dupCountput "Found " & dupCount & " duplicates of key " & prevKeyelse if dupCount > 1 then -- finished string of dupsif firstDup then -- handle case of first item in list.put prevKey into dupListput  number of this card - dupCount into dupCardsput false into firstDupelseput dupList & return & prevKey into dupList-- Put in the number of the first dup card.put dupCards & "," & number of this card - dupCount┬¼into dupCardsend ifput 1 into dupCountend ifput background field Key into prevKeyend ifgo to next cardend repeat-- If no dups, say so.if firstDup thenput "There were no duplicate keys."put "No Duplicates" into dupListput 0 into dupCardselseput "There were duplicated keys."play "PWscream"end ifpop cardset lockScreen to falseend checkKeyson dupKeysglobal dupList, dupCardsput the rect of the target into tempRectput item 1 of HPopUpMenu(dupList,0,(item 4 of tempRect)-1,┬¼(item 1 of tempRect)+1) into dupNumberif dupNumber is 0 then exit dupKeysput item dupNumber of dupCards into goCardif goCard <> 0 then go to card goCardend dupKeyson makeNewCardput bkgnd field "card Type" into typedoMenu "New Card"put type into background field "Card Type"put "?" into bkgnd field "Read Status"end makeNewCardon doMonthglobal monthListput the rect of the target into tempRectput item 1 of HPopupMenu(monthList,0,(item 4 of tempRect)-1,┬¼(item 1 of tempRect)+1) into monthNumberif monthNumber < 1 then exit doMonthelse put line monthNumber of monthList into background field "Month"end doMonthon doYearglobal yearListput the rect of the target into tempRectput item 1 of HPopupMenu(yearList,0,(item 4 of tempRect)-1,┬¼(item 1 of tempRect)+1) into yearNumberif yearNumber < 1 then exit doYearelse put line yearNumber of yearList into background field "Year"end doYearon setReadStatusglobal readStatusList-- Get the current value of the field so you can check it as correctly.put the short name of the target into statusNameif word 1 of the target is "card" thenput card field statusName into statusValueelseput bkgnd field statusName into statusValueend ifput 0 into checkItemrepeat with x = 1 to number of items in readStatusListif statusValue is item x of readStatusList thenput x into checkItemexit repeatend ifend repeat-- Convert the readStatusList to one that is return-separated.put item 1 of readStatusList into statusListrepeat with x = 2 to the number of items in readStatusListput statusList & return & item x of readStatusList into statusListend repeatput the rect of the target into tempRectput item 1 of HPopupMenu(statusList,checkItem,(item 2 of tempRect),┬¼(item 1 of tempRect)+1) into statusValueif statusValue = 0 then exit setReadStatuselse put item statusValue of readStatusList into the targetend setReadStatuson makeBibglobal bibFileName, firstRefCard, requiredEntry, lastReqEntryglobal termChar -- the character that terminates lines--  (linefeed for unix, return for mac).put "Make .bib for mac"&return&"Make .bib for Unix" into bibListput the rect of the target into tempRectput item 1 of HPopupMenu(bibList,0,(item 4 of tempRect)-1,┬¼(item 1 of tempRect)+1) into termChar-- set the termination character.if termChar is 0 then exit makeBibelse if termChar is 1 then put return into termCharelse put lineFeed into termChar-- Note that if you have created a handler for a new form of-- bibliograpy output, it would be called here.-- See what file name the user asks forput PutFile("Save bib file as:",bibFileName) into tempif temp is empty thenexit makeBibend ifput temp into bibFileName-- This test for a return error seems useless. I don't know how to-- intercept it.open file bibFileNameif the result is not empty thenanswer "Couldn't open file" with "OK"exit makeBibend ifset lockScreen to trueset cursor to 4push cardput the number of cards - firstRefCard+1 into totalCardNumgo to card firstRefCard-1repeat with cardCount = 1 to totalCardNumgo to next card-- Tell the user how things are going.put "Card " & cardCount & " of " & totalCardNum-- Do what you should for this card typeif background field Key is not empty thenput true into requiredEntryput false into lastReqEntryif the short name of this background is "Article" thendo "ArticleBib"else if the short name of this background is "Book" thendo "BookBib"else if the short name of this background is "Booklet" thendo "BookletBib"else if the short name of this background is "In Book" thendo "InBookBib"else if the short name of this background is "In Collection" thendo "InCollectionBib"else if the short name of this background is "In Proceedings" thendo "InProceedingsBib"else if the short name of this background is "Manual" thendo "ManualBib"else if the short name of this background is "Misc." thendo "MiscBib"else if the short name of this background is "Proceedings" thendo "ProceedingsBib"else if the short name of this background is "Tech Report" thendo "TechReportBib"else if the short name of this background is "Masters Thesis" thendo "MSThesisBib"else if the short name of this background is "Ph.d Thesis" thendo "PhdThesisBib"else if the short name of this background is "Unpublished" thendo "UnpublishedBib"end ifend ifend repeatpop cardset lockScreen to falseclose file bibFileNamehide message-- Save only the file name, not the full path.put LastPathComponent(bibFIleName) into bibFileNameend makeBibon DoLine -- make an entryglobal requiredEntry, lastReqEntry, bibFileName, termCharglobal lineName, lineFieldif requiredEntry thenwrite tab & lineName & " = {" & field lineField & "}" to file bibFileNameif not lastReqEntry thenwrite "," & termChar to file bibFileNameend ifelseif field lineField is not emptythen write "," & termChar & tab & lineName & " = {" &┬¼field lineField & "}" to file bibFileNameend ifend DoLineon AddressLineglobal lineName, lineFieldput "address" into lineNameput "address" into lineFielddo "DoLine"end AddressLineon AuthorLineglobal lineName, lineFieldput "author" into lineNameput "author" into lineFielddo "DoLine"end AuthorLineon BooktitleLineglobal lineName, lineFieldput "booktitle" into lineNameput "book title" into lineFielddo "DoLine"end BooktitleLineon ChapterLineglobal lineName, lineFieldput "chapter" into lineNameput "chapter" into lineFielddo "DoLine"end ChapterLineon EditionLineglobal lineName, lineFieldput "edition" into lineNameput "edition" into lineFielddo "DoLine"end EditionLineon EditorLineglobal lineName, lineFieldput "editor" into lineNameput "editor" into lineFielddo "DoLine"end EditorLineon HowpublishedLineglobal lineName, lineFieldput "howpublished" into lineNameput "how published" into lineFielddo "DoLine"end HowpublishedLineon InstitutionLineglobal lineName, lineFieldput "institution" into lineNameput "organization" into lineFielddo "DoLine"end InstitutionLineon JournalLineglobal lineName, lineFieldput "journal" into lineNameput "journal" into lineFielddo "DoLine"end JournalLineon KeyLineglobal termChar, bibFileNamewrite "{" & field Key & "," & termChar to file bibFileNameend KeyLineon LastLineglobal termChar, bibFileNamewrite " }" & termChar to file bibFileNameend LastLineon MonthLineglobal lineName, lineFieldput "month" into lineNameput "month" into lineFielddo "DoLine"end MonthLineon NumberLineglobal lineName, lineFieldput "number" into lineNameput "number" into lineFielddo "DoLine"end NumberLineon OrganizationLineglobal lineName, lineFieldput "organization" into lineNameput "organization" into lineFielddo "DoLine"end OrganizationLineon PagesLineglobal lineName, lineFieldput "pages" into lineNameput "pages" into lineFielddo "DoLine"end PagesLineon PublisherLineglobal lineName, lineFieldput "publisher" into lineNameput "publisher" into lineFielddo "DoLine"end PublisherLineon SchoolLineglobal lineName, lineFieldput "school" into lineNameput "organization" into lineFielddo "DoLine"end SchoolLineon SeriesLineglobal lineName, lineFieldput "series" into lineNameput "series" into lineFielddo "DoLine"end SeriesLineon TitleLineglobal lineName, lineFieldput "title" into lineNameput "title" into lineFielddo "DoLine"end TitleLineon TypeLineglobal lineName, lineFieldput "type" into lineNameput "type" into lineFielddo "DoLine"end TypeLineon bibliographyNoteLineglobal lineName, lineFieldput "note" into lineNameput "bibliography Note" into lineFielddo "DoLine"end bibliographyNoteLineon VolumeLineglobal lineName, lineFieldput "volume" into lineNameput "volume" into lineFielddo "DoLine"end VolumeLineon YearLineglobal lineName, lineFieldput "year" into lineNameput "year" into lineFielddo "DoLine"end YearLineon ArticleBibglobal bibFileName, requiredEntry, lastReqEntrywrite "@Article" to file bibFileNamedo "KeyLine"do "AuthorLine"do "TitleLine"do "JournalLine"put true into lastReqEntrydo "YearLine"put false into requiredEntrydo "VolumeLine"do "NumberLine"do "PagesLine"do "MonthLine"do "LastLine"end ArticleBibon BookBibglobal bibFileName, requiredEntry, lastReqEntrywrite "@BOOK" to file bibFileNamedo "KeyLine"do "AuthorLine"do "TitleLine"do "PublisherLine"put true into lastReqEntrydo "YearLine"put false into requiredEntrydo "VolumeLine"do "SeriesLine"do "AddressLine"do "EditionLine"do "MonthLine"do "LastLine"end BookBibon BookletBibglobal bibFileName, requiredEntry, lastReqEntrywrite "@Booklet" to file bibFileNamedo "KeyLine"put true into lastReqEntrydo "TitleLine"put false into requiredEntrydo "AuthorLine"do "HowpublishedLine"do "AddressLine"do "MonthLine"do "YearLine"do" LastLine"end BookletBibon InProceedingsBibglobal requiredEntry, bibFileName, lastReqEntrywrite "@InProceedings" to file bibFileNamedo "KeyLine"do "AuthorLine"do "TitleLine"do "BooktitleLine"put true into lastReqEntrydo "YearLIne"put false into requiredEntrydo "EditorLine"do "PagesLine"do "OrganizationLine"do "PublisherLine"do "AddressLine"do "MonthLine"do "LastLine"end InProceedingsBibon InBookBibglobal requiredEntry, bibFileName, lastReqEntrywrite "@InBook" to file bibFileNamedo "KeyLine"do "AuthorLine"do "TitleLIne"do "PublisherLine"put true into lastReqEntrydo "YearLine"put false into requiredEntrydo "ChapterLine"        -- chapter and pages are after the requireddo "PagesLine"          -- entries becuase only one is required.do "VolumeLine"do "SeriesLine"do "AddressLIne"do "EditionLine"do "MonthLIne"do "LastLine"end InBookBibon InCollectionBibglobal requiredEntry, bibFileName, lastReqEntrywrite "@InCollection" to file bibFileNamedo "KeyLine"do "AuthorLine"do "TitleLIne"do "BooktitleLine"do "PublisherLine"put true into lastReqEntrydo "YearLine"put false into requiredEntrydo "EditorLIne"do "ChapterLine"do "PagesLine"do "AddressLine"do "MonthLine"do "LastLine"end InCollectionBibon ManualBibglobal requiredEntry, bibFileName, lastReqEntrywrite "@Manual" to file bibFileNamedo "KeyLine"put true into lastReqEntrydo "TitleLine"put false into requiredEntrydo "AuthorLine"do "OrganizationLine"do "AddressLine"do "EditionLine"do "MonthLine"do "YearLine"do "LastLine"end ManualBibon MiscBibglobal requiredEntry, lastReqEntry, bibFileName, termCharwrite "@Misc" to file bibFileNameput true into lastReqEntrydo "KeyLine"if field author is not empty thendo "AuthorLine"put false into requiredEntryend ifif field title is not empty thendo "TitleLine"put false into requiredEntryend ifif field "how published" is not empty thendo "HowpublishedLine"put false into requiredEntryend ifif field month is not empty thendo "MonthLine"put false into requiredEntryend ifif field year is not empty thendo "YearLine"end ifdo "LastLine"end MiscBibon ProceedingsBibglobal requiredEntry, bibFileName, lastReqEntrywrite "@Proceedings" to file bibFileNamedo "KeyLine"do "TitleLine"put true into lastReqEntrydo "YearLine"put false into RequiredEntrydo "EditorLine"do "PublisherLine"do "OrganizationLine"do "AddressLIne"do "MonthLine"do "LastLine"end ProceedingsBibon TechReportBibglobal requiredEntry, bibFileName, lastReqEntrywrite "@TechReport" to file bibFileNamedo "KeyLine"do "AuthorLine"do "TitleLine"do "InstitutionLine"put true into lastReqEntrydo "YearLine"put false into requiredEntrydo "TypeLine"do "NumberLine"do "AddressLine"do "MonthLine"do "LastLine"end TechReportBibon MSThesisBib-- use phdthesis for both masters and phd theses. I don't know if-- these really should differ when printed.global requiredEntry, bibFileName, lastReqEntrywrite "@mastersthesis" to file bibFileNamedo "KeyLine"do "AuthorLine"do "TitleLine"do "SchoolLine"put true into lastReqEntrydo "YearLine"put false into requiredEntrydo "AddressLine"do "MonthLIne"do "LastLine"end MSThesisBibon PhdThesisBib-- use phdthesis for both masters and phd theses. I don't know if-- these really should differ when printed.global requiredEntry, bibFileName, lastReqEnt